<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 *  Home Controller  
 *  
 * @package XGO CMS v2.0 
 * @subpackage News  
 * @author Manh Nguyen - 30/07/2012 
 * @link http://sunsoft.vn
 */
class Home extends CI_Controller {

    /**
     * Contrust class
     *  
     * @access public 
     */
    public function __construct() {
        parent::__construct();
        $this->load->library('smarty3', '', 'smarty');
        
        require_once(APPPATH . 'modules/backend/autoload.php');        
        
        $this->load->library('login_manager');
        require_once(APPPATH . 'modules/backend/info.php');
        
        $this->load->language('backend');
        $this->smarty->assign('language', $this->lang);
        $this->smarty->assign('message', $this->session->flashdata('message'));
        $this->smarty->assign('error_message', $this->session->flashdata('error_message'));
    }

    public function index() {    	
        $parameters = $this->uri->ruri_to_assoc();
        if (isset($parameters['id'])) {
            $id = intval($parameters['id']);
            if ($id > 0) {
                $this->session->set_userdata('search_id', $id);
            }
        }  
            
        redirect(site_url("auth/statistics"));
//         require_once(APPPATH . 'modules/backend/history.php');
//         $this->smarty->display('template/backend/admin');
    }

    public function cpanel() {
        redirect(site_url('auth/cpanel/login'));
    }

}

/* End of file auth/cpanel.php */
/* Location: ./system/application/controllers/auth/cpanel.php */